package com.tyk.bookstore.back.system.model.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class MenuSuggestionVo {
    @Schema(description = "菜单ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private String id;
    @Schema(description = "菜单标题", requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;
    @Schema(description = "子菜单列表", requiredMode = Schema.RequiredMode.REQUIRED, nullable = true)
    private List<MenuSuggestionVo> children;

    public void addChild(MenuSuggestionVo vo) {
        if(this.children==null) this.children = new ArrayList<>();
        this.children.add(vo);
    }
}

